package com.zhong.gang.pda.mvp;

import android.content.Context;

import com.zhong.gang.pda.db.user.UserUtils;
import com.zhong.gang.applib.http.BaseDataBean;
import com.zhong.gang.applib.http.callback.Callback;
import com.zhong.gang.applib.http.callback.DataCallBack;
import com.zhong.gang.pda.api.Api;
import com.zhong.gang.pda.api.HttpUtils;
import com.zhong.gang.applib.ui.chese.MaterialTypeBean;

import java.util.List;

public class CommonPresenter {
    public static final void getMaterialType(Context context){
        HttpUtils.get(Api.getMaterialType,context)
                .addParams("materialYardId", UserUtils.getIntent(context).getUser().getMaterialYardId()+"")
                .addParams("type","0")
                .build().execute(new DataCallBack<BaseDataBean<List<MaterialTypeBean>>>(){
            @Override
            public void onResponse(BaseDataBean<List<MaterialTypeBean>> data) throws Exception {
                super.onResponse(data);
            }
        });
    }

    public static final void getSendCarList(Context context, Callback callback){
        HttpUtils.get(Api.getSendCarList,context)
                .addParams("X-HEADER-USER-ID", UserUtils.getIntent(context).getUser().getId()+"")
                .build().execute(callback);
    }
}
